<?php

	//获取用户积分信息接口－get_line.php
	//create by L 
	//http://42.121.57.193:7788/platform/get_line.php?phone=13011112222
	//成功返回0|积分数额

	include_once "init.php";
	
	$phone = $_GET["phone"];

	if('' == $phone )
	{
		die("-1|电话号码不可以为空");
	}
	if (strlen($phone) != 11 || false==is_numeric($phone) || ord($phone)!=49)
	{
		die("-1|手机号码必须是11位数字，并且以1开头");
	}	

	$con    = db_connect(DB_NAME);
	
	//获取积分字段
	$res = mysql_query("SELECT line_type,webline_id,sipline_id from user where phone='$phone'") or die("-1|查询数据库错误");
	$row = mysql_fetch_row($res);
	
	mysql_close($con);
	$line_type = $row['0'];
	$web_line = $row['1'];
	$sip_line = $row['2'];
	if (empty($row))
	{
		die("-1|该手机号码未注册");
	}

	echo '0|'.$line_type.'|'.$web_line.'|'.$sip_line;
?>